package com.agileai.bpm.domain.running;

import com.agileai.bpm.domain.define.ProcessVariable;
import com.agileai.util.StringUtil;

public class ProcessVariableInstance extends RunningObject {
	private String value = null;
	private ProcessInstance processInstance = null;
	private ProcessVariable processVariable = null;

	public ProcessInstance getProcessInstance() {
		return processInstance;
	}
	
	public void setProcessInstance(ProcessInstance processInstance) {
		this.processInstance = processInstance;
	}
	
	public ProcessVariable getProcessVariable() {
		return processVariable;
	}
	
	public void setProcessVariable(ProcessVariable processVariable) {
		this.processVariable = processVariable;
	}
	
	public String getCode() {
		return processVariable.getCode();
	}
	
	public String getVarType() {
		return processVariable.getVarType();
	}
	
	public String getValue() {
		if (StringUtil.isNullOrEmpty(value)){
			return processVariable.getInitialValue();
		}else{
			return value;	
		}
	}
	
	public void setValue(String value) {
		this.value = value;
	}
}